<!DOCTYPE html>
<html>
	<head>
	    <meta charset="UTF-8">
	    <title>事件冒泡</title>
	</head>
	<body>
	    <button id="click">点击</button>
	</body>
	<script>
	    (function(){
	        var btn = document.getElementById("click");
	        btn.onclick = function(event){
	            console.log("1. button");
	//          event.stopPropagation?event.stopPropagation():event.cancelBubble = true;
				console.log(event.target);   
	        }
	        document.body.onclick = function(e){
	            console.log("2. document.body");
	            console.log(e.target);
	        }
	        document.onclick = function(){
	            console.log("3. document");
	        }
	    })()
	</script>
</html>